<?php

/**
 * admin controller for admin management
 * 
 * @author HungPV <phamvanhung0818@gmail.com>
 * @package admin
 * @since 1.0
 */
class admin extends MX_Controller {

    function __construct() {
        parent::__construct();
        $this->load->model('category/category');
    }
    
    function index()
    {
        if($this->session->userdata('login')!=1)
        {
            redirect('admin/login');
        }
        else
        {
            redirect('admin/categories/show');
        }
    }

    function login() {
        echo Modules::run('users/index');
    }
    
    function setting()
    {
        echo Modules::run('users/setting');
    }

    function logout() {
        $arr = array(
            'login' => FALSE,
            'username' => ''
        );
        $this->session->unset_userdata($arr);
        redirect('admin/login');
    }

}

?>
